﻿Imports System
Imports System.IO
Imports System.Text
Imports SevenZip

Public Class dlgLogs

	Private Sub Form4_FormClosed(sender As Object, e As FormClosedEventArgs) Handles Me.FormClosed
		End
	End Sub

	Private Sub Form4_Load(sender As Object, e As EventArgs) Handles MyBase.Load
		Me.BringToFront()
		'Me.Focus()
	End Sub


	Private Sub FontToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles FontToolStripMenuItem.Click
	  If FontDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
			lsbLogs.Font = FontDialog.Font
	  End If
	End Sub

	''' <summary>
	''' 
	''' </summary>
	''' <param name="path_"></param>
	''' <remarks></remarks>
	Public Sub ListContents(ByVal path_ As String)
		Dim sb As New Text.StringBuilder
		Dim sb2 As New Text.StringBuilder

		Try
			frmExtract.sze = New SevenZipExtractor(path_)
		Catch ex As Exception
			Debug.Print(ex.Message)
		End Try

		lsbLogs.Items.Add("Archive: " & path_)
		lsbLogs.Items.Add("Length      Date    Time    Name")
		lsbLogs.Items.Add("--------- ---------- -----  ----")

		For Each item As SevenZip.ArchiveFileInfo In frmExtract.sze.ArchiveFileData
			lsbLogs.Items.Add(String.Format("{0,09} {1} {2}", item.Size, item.LastWriteTime.ToString("yy-MM-dd HH:mm:ss"), item.FileName))
		Next
	End Sub

End Class